import uuid from 'uuid';
import update from './atom/db/update';
import { IBaseTable } from './atom/db/interfaces';

declare const action_id: string;
declare const session_id: string;
declare const spaceid: string;

interface Message {
	sex: string,
	id_no: string,
	birthday: string,
	age: number,
	native_place: string,
	zodiac: string,
	blood_type: string,
	f_name: string,
	marital_status: string,
	politics_face: string,
	entry_party_time: string,
	reg_per_res: string,
	education: string,
	bachelo_ocience: string,
	staff_picture: string,
	accessory_url: string,
	province: string,
	staff_type: string,
	deptid: string,
	_id: string,
	deptname: string
}
async function atom(msg: Message) {
	const systemid = '6051';
	const { exec, prepare } = update(action_id, session_id, spaceid, systemid);
	prepare('teach_staff', [msg]);
	const res = await exec();
	if (res.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}